home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / newsgroups / misc.20000824-20010305 / 000351_news@columbia.edu _Fri Feb 23 11:16:29 2001.msg < prev    next >
Internet Message Format  |  2001-03-05  |  4KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from watsun.cc.columbia.edu (watsun.cc.columbia.edu [128.59.39.2])
  3.     by uhaligani.cc.columbia.edu (8.9.3/8.9.3) with ESMTP id LAA21781
  4.     for <kermit.misc@cpunix.cc.columbia.edu>; Fri, 23 Feb 2001 11:16:29 -0500 (EST)
  5. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  6.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id LAA03293
  7.     for <kermit.misc@watsun.cc.columbia.edu>; Fri, 23 Feb 2001 11:16:28 -0500 (EST)
  8. Received: (from news@localhost)
  9.     by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id LAA15323
  10.     for kermit.misc@watsun.cc.columbia.edu; Fri, 23 Feb 2001 11:00:35 -0500 (EST)
  11. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  12. From: fdc@columbia.edu (Frank da Cruz)
  13. Subject: Re: Help needed on writing scripts to transfer files by FTP
  14. Date: 23 Feb 2001 16:00:34 GMT
  15. Organization: Columbia University
  16. Message-ID: <9761f2$eup$1@newsmaster.cc.columbia.edu>
  17. To: kermit.misc@columbia.edu
  18.  
  19. In article <3A9647C3.473C192E@ssynth.co.uk>,
  20. Andrew Gay  <andrew@ssynth.co.uk> wrote:
  21. : Tien Nguyen wrote:
  22. : > 
  23. : > #!/bin/sh
  24. : > 
  25. : > ftp <<EOF
  26. : >     open 172.16.10.10
  27. : >     user abc cde
  28. : >     bin
  29. : >     get file1
  30. : >     quit
  31. : > EOF
  32. : > 
  33. : I am surprised by the number of incorrect responses to this, and people
  34. : posting so-called 'solutions' thay haven't actually tried.
  35. : Tien's suggestion above will not work.  ftp will still prompt for a username
  36. : and password (unless the account doesn't require one).
  37. : The 'correct' solution is to create a file .netrc in the user's home
  38. : directory.  See man netrc for details.
  39. There is a new correct response: a fully scriptable FTP client from the
  40. Kermit Project at Columbia University.  Not only is it scriptable but it
  41. does all the other things that everybody has been asking for all these
  42. years:
  43.  
  44.  . Security
  45.  . Recursion (directory-tree traversal)
  46.  . Character-set translation
  47.  . Atomic file movement
  48.  . Automatic text/binary mode switching
  49.  . Flexible file selection
  50.  . Preservation of dates and permissions
  51.  . Update and recovery modes
  52.  . Filename collision options
  53.  
  54. The command language can be used interactively (like a regular FTP client),
  55. in which case it is much friendlier than what you are used to: it gives
  56. help, it offers filename and keyword completion, and so forth.  The same
  57. command language can be used to write automated procedures, and it offers
  58. the programming features you need:
  59.  
  60.  . User-defined and built-in variables and arrays.
  61.  . User-defined and built-in functions.
  62.  . Block structure, scoping.
  63.  . Pattern matching.
  64.  . Decision making (nestable IF-ELSE, SWITCH)
  65.  . Looping (FOR, WHILE)
  66.  . Associative arrays
  67.  . Integer and floating-point arithmetic
  68.  
  69. And on and on.  The new FTP client is built in to C-Kermit 7.1, and is
  70. available for all varieties of UNIX: Solaris, Linux, AIX, IRIX, HP-UX,
  71. and all the rest.  You can find it here:
  72.  
  73.   http://www.columbia.edu/kermit/ftpclient.html
  74.  
  75. You can find a scripting tutorial here to help you get started:
  76.  
  77.   http://www.columbia.edu/kermit/ftpscript.html
  78.  
  79. And you can find complete documentation here:
  80.  
  81.   http://www.columbia.edu/kermit/ckermit3.html#x3
  82.  
  83. If you have questions, you can post them to:
  84.  
  85.   news:comp.protocols.kermit.misc
  86.  
  87. or send them by email to:
  88.  
  89.   kermit-support@columbia.edu
  90.  
  91. Give it a try -- it does all the things that people have been asking
  92. for all these years on the newsgroups.
  93.  
  94. - Frank